<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <textarea id="A" cols="30" rows="10">这是模块A</textarea>
    <button class="bb">按钮</button>
    <textarea id="B" cols="30" rows="10">这是模块B</textarea>
    <script>
        const a1=document.querySelector('#A');
        const b1=document.querySelector('#B');
        const bb=document.querySelector('.bb');
        var t;
        bb.onclick=function(){
t=a1.innerHTML;
a1.innerHTML=b1.innerHTML;
b1.innerHTML=t;
        }
    </script>
    <!-- <div>用户名:<input type="text" class="names"></div>
    <div>密&nbsp&nbsp&nbsp码:<input type="text" class="passwords"></div>
    <button onclick="nb()">登录</button>
<script>
    function nb() {
        const name=document.querySelector('.names');
        const password=document.querySelector('.passwords');
        if(name==''||password==''){
            
        }
    }
</script>    -->
<!-- <div class="login-form">
    <h2 class="text-center mb-4">登录</h2>
    <p class="error-message" id="error-message"></p>
    <input type="text" id="username" placeholder="账号">
    <input type="password" id="password" placeholder="密码">
    <button onclick="checkLogin()">登录</button>
</div>
<script>
    function checkLogin() {
        const username = document.getElementById('username').value;
        const password = document.getElementById('password').value;
        const errorMessage = document.getElementById('error-message');

        if (username === '' || password === '') {
            errorMessage.textContent = '账号/密码不能为空';
        } else if (username === 'abc' && password === '123') {
            errorMessage.textContent = '登录成功';
            errorMessage.style.color = 'green';
        } else {
            errorMessage.textContent = '账号密码不正确';
        }
    }
</script> -->
</body>
</html>